// 引入 react 依赖
import React, { Component } from 'react';
import { connect } from 'react-redux';
import { Text, View, Image, TouchableOpacity, ImageBackground, ScrollView, InteractionManager } from 'react-native';

// 引入第三方依赖
import _ from 'lodash';
import pureRender from 'pure-render-decorator';
import { Actions } from 'react-native-router-flux';

// antd 按需加载
import { } from 'antd-mobile-rn';

// 引入 处理数据 所需文件
import { } from './module.js'

// 引入样式
import Styles from './style.js';

// 引入公用组件
import { CacheImage } from '../../components/index.js'

// 引入工具包
import { } from '../../util/images.js';
import { press, size, ScreenWidth, borderBottom, pathHead, requestCardFollowAccount, defaultDataList, onEndReached, onRefresh, concatDataList, defaultPage } from '../../util/utils.js'

class FansItem extends Component {

	static propTypes = {

	}

	constructor(props) {
		super(props)
		this.state = {}
	}


	handleCardLike(options) {
		const { handleCardLike } = this.props
		requestCardLike.call(this, options).then(res => {
			handleCardLike()
		})
	}

	handleCardFollowAccount(options) {
		const { handleCardLike } = this.props
		requestCardFollowAccount.call(this, options).then(res => {
			handleCardLike()
		})
	}

	render() {
		const { data } = this.props
		console.log(data, 9999999)
		return (
			<View style={{
				padding: 15,
				paddingLeft: 0,
				backgroundColor: '#fff',
				...borderBottom()
			}}>
				<TouchableOpacity onPress={() => Actions.cardUserInfo({ id: data.id })}>
					<View style={{}}>
						<View style={{
							flexDirection: 'row',
							alignItems: 'center',
						}}>
							<CacheImage
								resizeMod={"contain"}
								style={{
									marginRight: 10,
									width: 42,
									height: 42,
									borderRadius: 21,
									overflow: 'hidden'
								}}
								source={{ uri: `${pathHead}${data.avatar}` }}

							/>
							<View style={{ flex: 1 }}>
								<Text style={{ fontSize: 14, color: '#333', lineHeight: 16, marginBottom: 10 }}>{data.nickname}</Text>
								<Text style={{ fontSize: 14, color: '#999', lineHeight: 16, }}>{data.followCount}人关注</Text>
							</View>
						</View>
					</View>
				</TouchableOpacity>
			</View>
		)
	}
}

export default pureRender(FansItem)
